/**
 * 
 */
package main;

import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

import model.Contact;
import services.ParserContacts;

/**
 * @author e412596
 * 
 */
public class Main {
   
    
    public static void main(String[] args) {
        File folder = new File("F:\\Address Book - All");
        ParserContacts parser = new ParserContacts();
        List < Contact > contacts = new ArrayList < Contact >();
        for (File file : folder.listFiles()) {
            contacts.add(parser.parse(file));
        }
        Collections.sort(contacts);
        
        String newFile = "C:\\Users\\e412596\\Desktop";
        try {
            parser.printContactsFile(contacts, newFile);
        } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }
}
